from typing import TypedDict, Literal
WSMessageTypes = Literal['throttle', "switch"]
TractionModes = Literal["forward", "reverse", "idle"]


class WSSpeedControlMsg(TypedDict):
    type: Literal["throttle"]
    train_name: str  # 列车名称
    throttle_value: int  # 油门开度
    traction_mode: TractionModes  # 牵引方向


class WSSwitchControlMsg(TypedDict):
    type: Literal["switch"]
    control_name: str
    switch_index: int
    state: Literal["A", "B"]


WSMessages = WSSpeedControlMsg | WSSwitchControlMsg
